﻿using LibraryManagement.Domain.UserManagement;
using System.Data.Entity.ModelConfiguration;

namespace LibraryManagement.DataAccess.Configuration
{
    public class UserConfig: EntityTypeConfiguration<User>
    {
        public UserConfig()
        {
            this.HasKey(u => u.Id);
            this.HasMany(u => u.Roles)
                .WithRequired()
                .HasForeignKey(r => r.UserId);
        }
    }
}
